<template>
	<view class="my-same-trade-lists-area">
		<navigator hover-class="none" :url="`/yixu/pages/network_square/contents/info?id=${item.id}&type=3`" class="my-same-trade-item u-padding-30" v-for="item in listDatas" :key="item.id">
			<view class="u-flex u-padding-bottom-10">
				<view class="u-flex u-flex-1">
					<text class="md">{{item.create_time}}</text>
					<text class="md u-padding-left-10 u-padding-right-10">发布</text>
				</view>
			</view>
			
			<view class="area-bg u-border-radius-10 u-margin-top-15 u-padding-20">
				<view>
					<text class="bold">申请人所在城市：</text>
					<text class="u-font-weight-500">{{item.city||'-'}}</text>
				</view>
				<view class="u-margin-top-15">
					<text class="bold">申请人当前年龄：</text>
					<text class="u-font-weight-500">{{item.age||'-'}}</text>
				</view>
				<view >
					<view class="bold u-margin-top-15">
						申请人资产情况：
					</view>
					<view class="nr u-margin-top-15">
						{{item.balance_situation||'-'}}
					</view>
				</view>
				<view >
					<view class="bold u-margin-top-15">
						申请人征信情况：
					</view>
					<view class="nr u-margin-top-15">
						{{item.credit_information||'-'}}
					</view>
				</view>
				<view class="bold u-padding-right-10">详细情况 :</view>
				<view class="u-padding-top-10">
					{{item.additional_information||'-'}}
				</view>
			</view>
		</navigator>
		<u-empty v-if="listDatas.length <= 0" class="u-padding-top-50 u-padding-bottom-50" text="暂无数据"
			mode="list"></u-empty>
	</view>
</template>

<script>
	import {
		queryConsultingExpertLists
	} from '@/api/networkSquare';
	import {
		loadingType
	} from "@/utils/type";
	import {
		loadingFun
	} from "@/utils/tools"
	export default {
		data() {
			return {
				page: 1,
				listDatas: [],
				initStatus: false,
				loadingStatus: loadingType.LOADING,
			}
		},
		props:{
			userId:{
				type:Number|String,
				default:0
			}
		},
		created() {
			this.queryListsDatas()
		},
		methods: {
			onPreviewImage(index, urls) {
				uni.previewImage({
					urls: urls,
					current: index
				})
			},
			clearDatas() {
				this.page = 1;
				this.listDatas = [];
				this.loadingStatus = loadingType.LOADING;
			},
			queryListsDatas() {
				let requestParams = {
					user_id:this.userId
				}
				let {
					page,
					listDatas,
					loadingStatus
				} = this;
				loadingFun(queryConsultingExpertLists, page, listDatas, loadingStatus, requestParams).then(res => {
					console.log(res)
					if (res) {
						this.page = res.page;
						this.listDatas = res.dataList
						this.loadingStatus = res.status
						console.log(listDatas)
						if (!this.initStatus) {
							this.$emit('initComplete')
							this.initStatus = true
						}
	
					}
				})
			}
		}
	}
</script>

<style lang="scss">
	.my-same-trade-item{
		position: relative;
		border-bottom: 2rpx solid #F5F5F5;
		
		&:before{
			top: 5%;
			right: 5%;
			content: ' ';
			width: 150rpx;
			height: 150rpx;
			position: absolute;
			background: url('https://resource.lanbaozixun.com/uploads/images/2025010713501876f1e9072.png') no-repeat 100%;
			background-size: 100% 100%;
			transform: rotateZ(-15deg);
		}
		
		&:last-child{
			border-bottom-color: transparent;
		}
	}
	
	.more-icon{
		transform: rotate(90deg);
	}
	
	.area-bg{
		background: #F7F7F7;
	}
</style>